import {reqUserAddressList,reqOrderInfo} from "@/api"
const state={
    addressInfo:[],
    userInfo:{}
}
const mutations={
    GETUSERADDRESSLIST(state,addressInfo){
        state.addressInfo=addressInfo
    },
    GETORDERINFO(state,userInfo){
        state.userInfo=userInfo
    }
}
const actions={
   async getUserAddressList({commit}){
        let result = await reqUserAddressList()
        if(result.code==200){
            console.log(1234,result.data);
            commit('GETUSERADDRESSLIST',result.data)
        }
    },
    async getOrderInfo({commit}){
        let result =await reqOrderInfo()
        if(result.code==200){
            console.log(123,result.data);
            commit("GETORDERINFO",result.data)
        }
    }
}
const getters={}
export default{
    state,
    mutations,
    actions,
    getters
}